#pragma once
#include "Com_h.h"
#include "define.h"

class CTest
{
public:
    CTest();
    ~CTest();

public:
    BEGIN_INTERFACE_PART(ComTest, ITest)
        virtual HRESULT STDMETHODCALLTYPE Test();
    END_INTERFACE_PART(ComTest)
};

class CTestFactory : public IClassFactory
{
public:
    CTestFactory();
    ~CTestFactory();

public:
    BEGIN_INTERFACE_TABLE()
        INTERFACE_TABLE_ENTRY(CTestFactory, IClassFactory)
    END_INTERFACE_TABLE()

    DECLARE_NONEW_INTERFACE();

public:

    //
    //  IClassFactory
    //

    virtual HRESULT STDMETHODCALLTYPE CreateInstance(
        IN OPTIONAL IUnknown* pUnkOuter,
        IN REFIID riid,
        OUT void** ppvObject
    );
    virtual HRESULT STDMETHODCALLTYPE LockServer(IN BOOL fLock);
};

EXTERN_C CTestFactory TestFactory;
